package com.che.software.testato.domain.entity;

import java.io.Serializable;

/**
 * Class representing an arrow in the procedural diagrams.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @see Serializable
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public class ProceduralArrow implements Serializable {

	/**
	 * Constants.
	 */
	private static final long serialVersionUID = 2884881320340298386L;

	/**
	 * Members.
	 */
	private int transitionId;
	private String label;

	/**
	 * Builder from label.
	 * 
	 * @param label the arrow label.
	 * @param transitionId the transition id.
	 */
	public ProceduralArrow(String label, int transitionId) {
		super();
		this.label = label;
		this.transitionId = transitionId;
	}

	/**
	 * Builder as a clone factory.
	 * 
	 * @param toClone the object to clone.
	 */
	public ProceduralArrow(ProceduralArrow toClone) {
		this(toClone.label, toClone.transitionId);
	}

	/**
	 * Getter for the private field value label.
	 * 
	 * @return the label field value.
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * Setting a value to the label field.
	 * 
	 * @param label the value to set.
	 */
	public void setLabel(String label) {
		this.label = label;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return label;
	}

	/**
	 * Getter for the private field value transitionId.
	 * 
	 * @return the transitionId field value.
	 */
	public int getTransitionId() {
		return transitionId;
	}

	/**
	 * Setting a value to the transitionId field.
	 * 
	 * @param transitionId the value to set.
	 */
	public void setTransitionId(int transitionId) {
		this.transitionId = transitionId;
	}
}